#include <stdio.h>
#include <signal.h>
#include <unistd.h>
void sig_handler (int n)
{
	printf("unblock...%d\n", n);
	return;
}
int main(int argc, char **argv)
{
	int m;
	signal (9,sig_handler);
	sigset_t set, oldset;
	//将信号集初始化为空
	sigemptyset (&set);
	//将2号信号增加到集合中
	sigaddset (&set, 9);
	 m = sigismember (&set, 9);
	//将set集合设置为进程的信号掩码集
	sigprocmask (SIG_SETMASK, &set, NULL);
	sleep (10);
	sigprocmask (SIG_UNBLOCK, &set, NULL);
	getchar();
	 //将2信号从集合中删除
	sigdelset (&set, 9);

	return 0;
}
